//
//  ByeCodeHeader.m
//  PlayerWorld
//
//  Created by 汪的一声就哭了！ on 16/6/22.
//  Copyright © 2016年 刘成. All rights reserved.
//

#import "ByeCodeHeader.h"

@implementation ByeCodeHeader

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.firstLabel = [[UILabel alloc] init];
        [self addSubview:self.firstLabel];
        self.firstLabel.font = [UIFont systemFontOfSize:14];
        self.firstLabel.text = @"玩法";
        self.firstLabel.numberOfLines = 2;
        
        self.playLabel = [[UILabel alloc] init];
        [self addSubview:self.playLabel];
        
        self.backgroundView = [[UIView alloc] init];
        [self addSubview:self.backgroundView];
        self.backgroundView.backgroundColor = [UIColor colorWithRed:233.0/255.0 green:234.0/255.0 blue:235.0/255.0 alpha:1];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.backgroundView addSubview:self.nameLabel];
        self.nameLabel.text = @"距本期截止：";
        self.nameLabel.font = [UIFont systemFontOfSize:13];
        
        self.timeLabel = [[UILabel alloc] init];
        [self.backgroundView addSubview:self.timeLabel];
        
        self.chooseBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.backgroundView addSubview:self.chooseBtn];
        [self.chooseBtn setTitle:@"机选" forState:UIControlStateNormal];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.firstLabel.frame = CGRectMake(10, 0, 14, 40);
    self.playLabel.frame = CGRectMake(34, 0, self.bounds.size.width-80, 40);
    self.backgroundView.frame = CGRectMake(0, 40, self.bounds.size.width, 40);
    self.nameLabel.frame = CGRectMake(10, 0, 90, 40);
    self.timeLabel.frame = CGRectMake(100, 0, 150, 40);
    self.chooseBtn.frame = CGRectMake(self.bounds.size.width-60, 10, 50, 20);
}
@end
